<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>武汉理工大学出版社</title>
    <script src="js/jquery-3.2.1.min.js"></script>
    <script src="js/rem.js"></script>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/page_div.css">
    <script src="js/v3.2.8/vue.global.prod.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/axios.min.js"></script>
</head>
<body>
<!-- 头部 -->
<!--<div id="header"></div>-->
<div class="details" id="app">
    <div class="live" v-html="content"></div>
</div>
<!-- 底部 -->
<div id="footer"></div>
</body>

<script>
    const App = {
        data() {
            return {
                counter: 0,
                content: '',
            }
        },
        mounted() {
            this.getSingle();
        },
        methods: {
            async getSingle() {
                let type = getQueryVariable("type")
                let that = this;
                await axios({
                    method: "get",
                    url: "http//dbs.wutp.com.cn/CM-API/memberApi/auth/getSingle",
                }).then(function (res) {
                    for (var i = 0; i < res.data.data.length; i++) {
                        if (res.data.data[i].type == 'YSXY' && type == 2) {
                            that.content = res.data.data[i].content
                        }
                        if (res.data.data[i].type == 'YHXY' && type == 1) {
                            that.content = res.data.data[i].content
                        }
                        console.log(that.content)
                    }
                })
            },
        },
    };
    Vue.createApp(App).mount('#app');

    function getQueryVariable(variable) {
        const query = window.location.search.substring(1);
        const vars = query.split("&");
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split("=");
            if (pair[0] == variable) {
                return pair[1];
            }
        }
        return (false);
    }
</script>

<style>
    .live {
        margin: 0 3rem;
        padding: 0.06rem 0;
    }

</style>
</html>
